home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7974 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: anvil.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is &Variable (declared as: char Variable[10])?
  5. Date: 28 Feb 1996 08:33:03 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4h203vINNm29@anvil.ugrad.cs.ubc.ca>
  8. References: <4gqpa1$3h9@alcor.usc.edu> <4gtab6$acb@ceylon.gte.com> <313318b8.53776146@nntp.ix.netcom.com> <1177@altheim.win-uk.net>
  9. NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
  10.  
  11. In article <1177@altheim.win-uk.net>,
  12. Brian R. Oldham <broldham@altheim.win-uk.net> wrote:
  13.  
  14. >I think Brenda is right. No-one has said that arrays are pointers, but
  15. >the name of an array is. It is the address of the first element of an
  16.  
  17. Oh really? If the name of an array _is_ a pointer, then how come
  18.  
  19.     sizeof(name_of_array)
  20.  
  21. doesn't yield the size of a _pointer_?
  22.  
  23. Gotcha! :)
  24.  
  25. The name of an array _in certain expression contexts_ collapses into a pointer
  26. type and value. But you can't say that it _is_ a pointer, because it is not. It
  27. is an array and that's that.
  28.  
  29. >array. My understanding is that &myarray is allowable in C++, but not
  30. >in C. Anyone confirm this?
  31.  
  32. False. This locution has been blessed by ANSI long ago. It gives a pointer to
  33. the whole array object, as I have already ``pointed'' out in my other article
  34. in this thread. 
  35. -- 
  36.  
  37.